<?php
$str = "abcabcabc";
$num=0;
substr_replace($str,'a',$num);
echo $num;